//
// Created by Administrator on 2020/10/28.
//

#ifndef CSP_INCLUDE_UTILS_OBJARC_H_
#define CSP_INCLUDE_UTILS_OBJARC_H_

#include "commDef.h"

#ifdef __cplusplus
extern "C"
{
#endif

/******************************************************************************
 atomic reference counting : 引用计数器
 ******************************************************************************/

typedef struct ObjArc
{
    int32_t refCount;
} S_ObjArc;

void OARC_Init(S_ObjArc *self, int32_t refCount);
int32_t OARC_IncCount(S_ObjArc *self);
int32_t OARC_DecCount(S_ObjArc *self);
int32_t OARC_GetCount(S_ObjArc *self);

#ifdef __cplusplus
}
#endif

#endif //CSP_INCLUDE_UTILS_OBJARC_H_
